// Learn TypeScript:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html

const {ccclass, property} = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {

    @property(cc.Label)
    gOverLb: cc.Label = null;

    @property(cc.Label)
    replayLb: cc.Label = null;

    onLoad () {
        this.replayLb.node.on(cc.Node.EventType.TOUCH_START, this.replay);
    }

    replay() {
        console.log("replay");
        cc.director.preloadScene("game_scene", function () {
            console.log("加载成功");
            cc.director.loadScene("game_scene");
        }.bind(this));
    }

    start () {
        
    }

    update (dt) {}

    onDestroy(): void {

    }
}
